<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>Question Manager</title>
        <script type="text/javascript">  
            function expand(id) {
                var el=document.getElementById(id);
                if (el.style.display!="none"){
                    el.style.display="none";
                }else{
                    el.style.display="block";
                }
            }
        </script>  
    </head>
    <body bgcolor="white">
        <%@include file="tpl_header.jsp"%>
        <table width="100%" border="0">
            <tr>
                <td width="65%" >  
                    <%@include file="QuestionMess.jsp"%>
                    <table width="100%" border="0">
                        <tr>
                            <td><a href="#" onClick="expand('newtemplate');"><img src="imgs/expand.jpg" alt="Expand"></a>Sub Template:</td>
                        </tr>
                    </table>
                    <div id="newtemplate" style="display:block">  
                        <form action="" method=post>
                            <% if (n.getCurr_temp()==null) { %>
                            <textarea name=subtpl rows="5" cols="80"><%=nonull(n.getQuestion0())%></textarea><p>
                             <%}else{ %>
                             <textarea name=subtpl rows="5" cols="80"><%=nonull(n.getCurr_temp())%></textarea><p>
                             <%} %>
			    <input name="submit" type=submit value="Add Template">
                      </form>
                    </div>    
                                        <table width="100%" border="0">
                
                <tr>
                    <td><a href="#" onClick="expand('DBTpllist');"><img src="imgs/expand.jpg" alt="Expand"></a>List of Sub Templates: 
                    </td> 
                </tr>
            </table>
            <div id="DBTpllist" style="display:block"> 
                
                        <% for (var_count = 0; var_count < TplList.size(); var_count++) {%> 
                        <form action="" method=post>                        
                        <input name="submittpl" type=submit value="Delete">    
                        <%=var_count+1%>: <%=TplList.get(var_count)%> 
                        
                        <input name="tpl_id" type="hidden" value=<%=var_count%>><p>
                        
                        </form>
                        <%}%>
            </div>  
                </td>
                <%@include file="QuestionPreview.jsp" %>
            </tr>
        </table>
        <table>
            <tr>            
                <%if (!n.getHint().equals("no hint")) {%>
            <font color="red"><%=n.getHint()%></font><br>
            <%}%>
            </tr>
			 </table>

                                                   <table width="100%" border="0">                                                        
                                                        <tr>
                                                            <td><a href="#" onClick="expand('DBquestionlist');"><img src="imgs/expand.jpg" alt="Expand"></a>List of Questions: 
                                                            </td> 
                                                        </tr>
                                                    </table>
                                                    <div id="DBquestionlist" style="display:block"> 




                                                        <%@include file="QuestionList.jsp"%> 
                                                    </div>  


            <%@include file="tpl_footer.jsp"%>
    </body>
</html>